{extend name="public:base" /}
{block name="header"}
<style>
    .tabinfo tr {height:37px; }
            .form input{
                width:300px;
                padding:5px;
            }
            .form input:focus{
                border:1px solid #ff0000;
            }
</style>
{/block}
{block name="main"}

    <div class="ShareAnyContainer" style="font-size: 14px;">
        当前位置：<a href="{:url('shop/index/index')}" title="首页">首页</a>&nbsp;&nbsp;/&nbsp;&nbsp;<a
            href="{:url('shop/account/userinformation')}" title="个人资料">个人资料</a>
    </div>
    <div class="ShareAnySeparate"></div>
    <div class="ShareAnyContainer">
        <div class="line"></div>
    </div>
    <div class="ShareAnySeparate"></div>
    <div class="ShareAnyContainer">
      
        <table  width=100% border="0">
            <tr>
                <td valign="top" width="20%">{include file="public/account" /}</td>
                <td valign="top" width="5%">&nbsp;</td>
                <td valign="top" width="75%" style="line-height: 50px; text-align: center;" class="form">
                    <p style="text-align: left; font-size: 25px;">个人资料</p>
                    <TABLE class="tabinfo">
                    <TR><TD align="left">
					<div class="ShareAnySeparate"><b>姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：</b><input type="text" id="name" value="{$userInfo['name']}" style="width: 222px; height: 18px"></div>
					
					 </td></tr>
					 
					 <tr><td align="left">
              <div class="ShareAnySeparate"><b>性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别：</b>
            		<label for="sex0">
                        <input type="radio" name="sex" value="保密"  {if condition="$userInfo['sex'] eq '保密'"} checked="checked" {/if} tabindex="2"  id="sex0" style="width: 32px; "/>保密
                    </label>
            		<label for="sex1">
                        <input type="radio" name="sex" value="男" {if condition="$userInfo['sex'] eq '男'"}checked="checked" {/if} tabindex="3"  id="sex1" style="width: 32px; "/>男
                    </label>
            		<label for="sex2">
                        <input type="radio" name="sex" value="女" {if condition="$userInfo['sex'] eq '女'"} checked="checked" {/if}  tabindex="4"  id="sex2" style="width: 32px; "/>女
                    </label>
		
                 </div>
                    </td>
					</tr>
					 
                    <tr>
                    <td align="left">
                   
                    
                    <fieldset class="radio_wrap label">
		<div class="ShareAnySeparate"><b>出生日期：</b>
            <input type="text" id="birthday" value="{$userInfo['birthday']}" style="width: 222px; height: 18px" onclick="fPopCalendar(event,this,this)" onfocus="this.select()" readonly="readonly" />
	</div>
	</td>
	
	
	</tr>
	
					<TR><TD align="left">
					<div class="ShareAnySeparate"><b>手机号码：</b><input type="text" id="mobile" value="{$userInfo['mobile']}" style="width: 222px; height: 18px"></div>
					
					 </td></tr>
					 
					 <TR><TD align="left">
					<div class="ShareAnySeparate"><b>邮寄地址：</b><input type="text" id="address" value="{$userInfo['address']}" style="width: 222px; height: 18px"></div>
					
					 </td></tr>
					  <TR><TD align="left">
					  <div class="ShareAnySeparate">
					<b>邮政编码：</b><input type="text" id="postcode" value="{$userInfo['postcode']}" style="width: 222px; height: 18px">
					</div>
					 </td></tr>
					 <TR><TD align="left"><div class="ShareAnySeparate">
					<b>教育程度：</b>
                        <select name="education"   id="education" style="width: 222px; height: 25px">
						<option value="0"  {if condition="$userInfo['education'] eq '0'"} selected="selected" {/if}>
                            请选择...
                        </option>
						<option value="博士以及以上" {if condition="$userInfo['education'] eq '博士以及以上'"} selected="selected" {/if}>博士以及以上</option>
						<option value="硕士" {if condition="$userInfo['education'] eq '硕士'"} selected="selected" {/if} >硕士</option>
						<option value="本科" {if condition="$userInfo['education'] eq '本科'"} selected="selected" {/if}>本科</option>
						<option value="大专" {if condition="$userInfo['education'] eq '大专'"} selected="selected" {/if}>大专</option>
						<option value="其他" {if condition="$userInfo['education'] eq '其他'"} selected="selected" {/if}>其他</option>
						<select>						
					</div>
					 </td></tr>
					 <TR><TD align="left"> <div class="ShareAnySeparate">
					<b>毕业院校：</b>
                    <input type="text" id="school" value="{$userInfo['school']}" style="width: 222px; height: 18px">
					</div>
					 </td></tr>
					 <TR><TD align="left"><div class="ShareAnySeparate">
					 <b>年&nbsp;&nbsp;收&nbsp;&nbsp;入：</b><select name="income"   id="income" style="width: 222px; height: 25px">
								<option value="0"  {if condition="$userInfo['income'] eq '0'"} selected="selected" {/if}>请选择...</option>
								<option value="1000万以上" {if condition="$userInfo['income'] eq '1000万以上'"} selected="selected" {/if}>1000万以上</option>
								<option value="500－1000万" {if condition="$userInfo['income'] eq '500－1000万'"} selected="selected" {/if} >500－1000万</option>
								<option value="100－500万" {if condition="$userInfo['income'] eq '100－500万'"} selected="selected" {/if}>100－500万</option>
								<option value="50－100万" {if condition="$userInfo['income'] eq '50－100万'"} selected="selected" {/if}>50－100万</option>
								<option value="10－50万" {if condition="$userInfo['income'] eq '10－50万'"} selected="selected" {/if}>10－50万</option>
								<option value="5－10万" {if condition="$userInfo['income'] eq '5－10万'"} selected="selected" {/if}>5－10万</option>
								<option value="5万以下" {if condition="$userInfo['income'] eq '5万以下'"} selected="selected" {/if}>5万以下</option>
							</select>							
							</div>
							</td></tr>
					<TR height="50px"><TD>
					<div class="ShareAnySeparate">
                        <button id="submit" style="height:50px;width:150px;">保    存</button>
                        </div>
					</TD></TR>
					</TABLE>
                </td>
            </tr>
        </table>

		<input type="hidden" id="redirect" value="">
    </div>
{/block}
{block name="footer"}
    <script>
        $(document).ready(function () {
            $("#submit").on("click", function () {
                $.ajax({
                    url: "{:url('shop/account/ajaxUserinformation')}",
                    type: "POST",
                    dataType: "JSON",
                    data: {
                        name: $("#name").val(),
                        birthday:$("#birthday").val(),
                        mobile:$("#mobile").val(),
                        address: $("#address").val(),
                        postcode:$("#postcode").val(),
                        income:$("#income").val(),
                        education:$("#education").val(),
                        school:$("#school").val(),
                        sex:$("input[name='sex']:checked").val()
                    },
                    success: function (data) {
                        alert(data.msg);
                        if (data.code == "0") {
                            window.location.href = "{:url('shop/account/index')}";
                        }

                    }
                });
            });
        });
    </script>
    
  <script type="text/javascript">
var gMonths=new Array("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月");
var WeekDay=new Array("日","一","二","三","四","五","六");
var strToday="今天";
var strYear="年";
var strMonth="月";
var strDay="日";
var splitChar="-";
var startYear=1910;
var endYear=2010;
var dayTdHeight=12;
var dayTdTextSize=12;
var gcNotCurMonth="#E0E0E0";
var gcRestDay="#FF0000";
var gcWorkDay="#444444";
var gcMouseOver="#79D0FF";
var gcMouseOut="#F4F4F4";
var gcToday="#444444";
var gcTodayMouseOver="#6699FF";
var gcTodayMouseOut="#79D0FF";
var gdCtrl=new Object();
var goSelectTag=new Array();
var gdCurDate=new Date();
var giYear=gdCurDate.getFullYear();
var giMonth=gdCurDate.getMonth()+1;
var giDay=gdCurDate.getDate();
function ljq(){
    var elements=new Array();
    for(var i=0;i<arguments.length;i++) 
    {
        var element=arguments[i];
        if(typeof(arguments[i])=='string')
        {
            element=document.getElementById(arguments[i]);
        }
        if(arguments.length==1)         {return element;}
        elements.Push(element);
    }
    return elements;
}

Array.prototype.Push=function(){var startLength=this.length;for(var i=0;i<arguments.length;i++){this[startLength+i]=arguments[i];}return this.length;}
String.prototype.HexToDec=function(){return parseInt(this,16);}
String.prototype.cleanBlank=function(){return this.isEmpty()?"":this.replace(/\s/g,"");}
function checkColor(){var color_tmp=(arguments[0]+"").replace(/\s/g,"").toUpperCase();var 
model_tmp1=arguments[1].toUpperCase();var model_tmp2="rgb("+arguments[1].substring(1,3).HexToDec()+","+arguments[1].substring(1,3).HexToDec()+","+arguments[1].substring(5).HexToDec()+")";model_tmp2=model_tmp2.toUpperCase();if(color_tmp==model_tmp1 ||color_tmp==model_tmp2){return true;}return false;}
function ljqV(){return ljq(arguments[0]).value;}
function fPopCalendar(evt,popCtrl,dateCtrl){evt.cancelBubble=true;gdCtrl=dateCtrl;fSetYearMon(giYear,giMonth);var point=fGetXY(popCtrl);with(ljq("calendardiv").style){left=point.x+"px";top=(point.y+popCtrl.offsetHeight+1)+"px";visibility='visible';zindex='99';position='absolute';}ljq("calendardiv").focus();}
function fSetDate(iYear,iMonth,iDay){var iMonthNew=new String(iMonth);var iDayNew=new String(iDay);if(iMonthNew.length<2){iMonthNew="0"+iMonthNew;}if(iDayNew.length<2){iDayNew="0"+iDayNew;}gdCtrl.value=iYear+splitChar+iMonthNew+splitChar+iDayNew;fHideCalendar();}
function fHideCalendar(){ljq("calendardiv").style.visibility="hidden";for(var i=0;i<goSelectTag.length;i++){goSelectTag[i].style.visibility="visible";}goSelectTag.length=0;}
function fSetSelected(){var iOffset=0;var iYear=parseInt(ljq("tbSelYear").value);var iMonth=parseInt(ljq("tbSelMonth").value);var aCell=ljq("cellText"+arguments[0]);aCell.bgColor=gcMouseOut;with(aCell){var iDay=parseInt(innerHTML);if(checkColor(style.color,gcNotCurMonth)){iOffset=(innerHTML>10)?-1:1;}iMonth+=iOffset;if(iMonth<1){iYear--;iMonth=12;}else if(iMonth>12){iYear++;iMonth=1;}}fSetDate(iYear,iMonth,iDay);}
function Point(iX,iY){this.x=iX;this.y=iY;}
function fBuildCal(iYear,iMonth){var aMonth=new Array();for(var i=1;i<7;i++){aMonth[i]=new Array(i);}var dCalDate=new Date(iYear,iMonth-1,1);var iDayOfFirst=dCalDate.getDay();var iDaysInMonth=new Date(iYear,iMonth,0).getDate();var iOffsetLast=new Date(iYear,iMonth-1,0).getDate()-iDayOfFirst+1;var iDate=1;var iNext=1;for(var d=0;d<7;d++){aMonth[1][d]=(d<iDayOfFirst)?(iOffsetLast+d)*(-1):iDate++;}for(var w=2;w<7;w++){for(var d=0;d<7;d++){aMonth[w][d]=(iDate<=iDaysInMonth)?iDate++:(iNext++)*(-1);}}return aMonth;}
function fDrawCal(iYear,iMonth,iCellHeight,iDateTextSize){var colorTD=" bgcolor='"+gcMouseOut+"' bordercolor='"+gcMouseOut+"'";var styleTD=" valign='middle' align='center' style='height:"+iCellHeight+"px;font-weight:bolder;font-size:"+iDateTextSize+"px;";var dateCal="";dateCal+="<tr>";for(var i=0;i<7;i++){dateCal+="<td"+colorTD+styleTD+"color:#990099'>"+WeekDay[i]+"</td>";}dateCal+="</tr>";for(var w=1;w<7;w++){dateCal+="<tr>";for(var d=0;d<7;d++){var tmpid=w+""+d;dateCal+="<td"+styleTD+"cursor:pointer;' onclick='fSetSelected("+tmpid+")'>";dateCal+="<span id='cellText"+tmpid+"'></span>";dateCal+="</td>";}dateCal+="</tr>";}return dateCal;}
function fUpdateCal(iYear,iMonth){var myMonth=fBuildCal(iYear,iMonth);var i=0;for(var w=1;w<7;w++){for(var d=0;d<7;d++){with(ljq("cellText"+w+""+d)){parentNode.bgColor=gcMouseOut;parentNode.borderColor=gcMouseOut;parentNode.onmouseover=function(){this.bgColor=gcMouseOver;};parentNode.onmouseout=function(){this.bgColor=gcMouseOut;};if(myMonth[w][d]<0){style.color=gcNotCurMonth;innerHTML=Math.abs(myMonth[w][d]);}else{style.color=((d==0)||(d==6))?gcRestDay:gcWorkDay;innerHTML=myMonth[w][d];if(iYear==giYear && iMonth==giMonth && myMonth[w][d]==giDay){style.color=gcToday;parentNode.bgColor=gcTodayMouseOut;parentNode.onmouseover=function(){this.bgColor=gcTodayMouseOver;};parentNode.onmouseout=function(){this.bgColor=gcTodayMouseOut;};}}}}}}
function fSetYearMon(iYear,iMon){ljq("tbSelMonth").options[iMon-1].selected=true;for(var i=0;i<ljq("tbSelYear").length;i++){if(ljq("tbSelYear").options[i].value==iYear){ljq("tbSelYear").options[i].selected=true;}}fUpdateCal(iYear,iMon);}
function fPrevMonth(){var iMon=ljq("tbSelMonth").value;var iYear=ljq("tbSelYear").value;if(--iMon<1){iMon=12;iYear--;}fSetYearMon(iYear,iMon);}
function fNextMonth(){var iMon=ljq("tbSelMonth").value;var iYear=ljq("tbSelYear").value;if(++iMon>12){iMon=1;iYear++;}fSetYearMon(iYear,iMon);}
function fGetXY(aTag){var oTmp=aTag;var pt=new Point(0,0);do{pt.x+=oTmp.offsetLeft;pt.y+=oTmp.offsetTop;oTmp=oTmp.offsetParent;}while(oTmp.tagName.toUpperCase()!="BODY");return pt;}
function getDateDiv(){var noSelectForIE="";var noSelectForFireFox="";if(document.all){noSelectForIE="onselectstart='return false;'";}else{noSelectForFireFox="-moz-user-select:none;";}var dateDiv="";dateDiv+="<div id='calendardiv' onclick='event.cancelBubble=true' "+noSelectForIE+" style='"+noSelectForFireFox+"position:absolute;z-index:99;visibility:hidden;border:1px solid #999999;'>";dateDiv+="<table border='0' bgcolor='#E0E0E0' cellpadding='1' cellspacing='1' >";dateDiv+="<tr>";dateDiv+="<td><input type='button' id='PrevMonth' value='<' style='height:20px;width:20px;font-weight:bolder;' onclick='fPrevMonth()'>";dateDiv+="</td><td><select id='tbSelYear' style='border:1px solid;' onchange='fUpdateCal(ljqV(\"tbSelYear\"),ljqV(\"tbSelMonth\"))'>";for(var i=startYear;i<endYear;i++){dateDiv+="<option value='"+i+"'>"+i+strYear+"</option>";}dateDiv+="</select></td><td>";dateDiv+="<select id='tbSelMonth' style='border:1px solid;' onchange='fUpdateCal(ljqV(\"tbSelYear\"),ljqV(\"tbSelMonth\"))'>";for(var i=0;i<12;i++){dateDiv+="<option value='"+(i+1)+"'>"+gMonths[i]+"</option>";}dateDiv+="</select></td><td>";dateDiv+="<input type='button' id='NextMonth' value='>' style='height:20px;width:20px;font-weight:bolder;' onclick='fNextMonth()'>";dateDiv+="</td>";dateDiv+="</tr><tr>";dateDiv+="<td align='center' colspan='4'>";dateDiv+="<div style='background-color:#cccccc'><table width='100%' border='0' cellpadding='3' cellspacing='1'>";dateDiv+=fDrawCal(giYear,giMonth,dayTdHeight,dayTdTextSize);dateDiv+="</table></div>";dateDiv+="</td>";dateDiv+="</tr><tr><td align='center' colspan='4' nowrap>";dateDiv+="<span style='cursor:pointer;font-weight:bolder;' onclick='fSetDate(giYear,giMonth,giDay)' onmouseover='this.style.color=\""+gcMouseOver+"\"' onmouseout='this.style.color=\"#000000\"'>"+strToday+":"+giYear+strYear+giMonth+strMonth+giDay+strDay+"</span>";dateDiv+="</tr></tr>";dateDiv+="</table></div>";return dateDiv;}
with(document){onclick=fHideCalendar;write(getDateDiv());}
</script>
{/block}